package com.windy.i18n.config;

import com.windy.i18n.constant.ResolverType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Created by liyufeng on 2022/5/15
 */
@Data
@Accessors(chain = true)
@ConfigurationProperties(I18nProperties.PREFIX)
public class I18nProperties {
    public static final String PREFIX = "i18n";

    private String basename;

    private String defaultEncoding;

    private boolean concurrentRefresh;

    private boolean useCodeAsDefaultMessage;

    private int cacheSeconds;

    private String defaultLocale;

    private String supportedLocales;

    private Interceptor interceptor;

    @Data
    public static class Interceptor {
        private String name;
        private ResolverType type;
        private String patterns;
    }
}
